package com.cnap.multiclouldmgmt.model.enums;
/**
 * 枚举类型
 * @author dyq
 */
public enum K8sRoleEnum {

    Master("主节点","master"),

    Slave("从节点","node");

    private String chineseStatus;

    private String status;

    K8sRoleEnum(String chineseStatus, String status) {

        this.chineseStatus = chineseStatus;
        this.status = status;
    }

    /**
     * get
     *
     * @return ChineseStatus
     */
    public String getChineseStatus() {
        return chineseStatus;
    }

    /**
     * set
     *
     * @param chineseStatus chineseStatus
     */
    public void setChineseStatus(String chineseStatus) {
        this.chineseStatus = chineseStatus;
    }

    /**
     * get
     *
     * @return Status
     */
    public String getStatus() {
        return status;
    }

    /**
     * set
     *
     * @param status status
     */
    public void setStatus(String status) {
        this.status = status;
    }

    public static String getChineseStatusByStatus(String status){
        for(K8sRoleEnum k8sRoleEnum : K8sRoleEnum.values()){

            if (k8sRoleEnum.getStatus().equals(status)){

                return k8sRoleEnum.getChineseStatus();
            }
        }

        return null;
    }

    public static String getStatusByChineseStatus(String chineseStatus){
        for(K8sRoleEnum k8sRoleEnum : K8sRoleEnum.values()){

            if (k8sRoleEnum.getChineseStatus().equals(chineseStatus)){

                return k8sRoleEnum.getStatus();
            }
        }

        return null;
    }
}
